

<template>
  <p>test</p>
</template>

<script>
import { onMounted, getCurrentInstance } from "vue";
export default {
  name: "HelloWord",
  data() {
    return {
      x: 1,
      y: 2,
    };
  },
  // setup是组合式api的入口
  setup() {
    console.log("setup this:", this);

    onMounted(() => {
      console.log("onMounted this:", this);
    });

    const instance = getCurrentInstance();
    console.log("instance:", instance);
  },
  mounted() {
    console.log("this:", this);
    console.log(this.x, this.y);
  },
};
</script>

<style scoped>
</style>
